jQuery(function($){

    var typeId = $("#typeId").val();
    var type = $("[name=typeId]");
    var rid = null;

    $.ajax({
        type:"GET",
        url:"/sys/dictinary/listType",
        data:{type:'MISSION_TYPE'},
        dataType:"text",
        success:function(data){
            type.append("<option value=''>--请选择--</option>");
            var obj = JSON.parse(data);
            for(var i=0;i<obj.length;i++){
                if (typeId==obj[i].id){
                    type.append("<option value="+obj[i].id+" selected>"+obj[i].valueName+"</option>");
                } else{
                    type.append("<option value="+obj[i].id+">"+obj[i].valueName+"</option>");
                }
            }
        },
        error:function(data){
            alert("异常");
        }
    });
    function radio(id){
        var val = document.getElementById(id);
        val.checked=true;
        rid = id;
        /*var val = document.getElementById(id);
        if (val.checked==true){
            rid = id;
        }*/
    }
    window.radio=radio;

    function dispose(){
        if (rid!=null&&rid!=""){
            window.location.href = "/sys/mission/dispose?id=" + rid;
        }else{
            alert("请选中一行");
        }

    }
    window.dispose=dispose;
    queryList($("#formIndex").get(0), 1);
})